package org.cmind.soap.android;

import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.DefaultHttpClient;

public class HttpClientDecorator {

    public static DefaultHttpClient setAuth(DefaultHttpClient dhc, String userName, String password) {
        CredentialsProvider credentials = dhc.getCredentialsProvider();
        credentials.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(userName, password));
        return dhc;
    }
}
